#include <bits/stdc++.h>
using namespace std;
namespace Solve{
	typedef long long ll;
	char buf[1<<23],*p1=buf,*p2=buf;
	#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
	inline int rd(){
		int x=0,f=1;char ch=getchar();
		while(!isdigit(ch)){if(ch=='-') f=-1;ch=getchar();}
		while(isdigit(ch)) x=x*10+(ch^48),ch=getchar();
		return x*f;
	}
	void print(__int128 x){
		if(x>=10)print(x/10);
		cout<<(int)(x%10);
	}
	const int N=2000010;
	int id,T,n,k,a[N],b[N];ll c[N];
	
	int x[N];
	
	void main(){
		id=rd(),T=rd();
		for(int tt=1;tt<=T;tt++){
			n=rd(),k=rd();
			for(int i=1;i<n;i++)a[i]=rd();
			for(int i=1;i<=k;i++)b[i]=rd();
			
			if(k==0){
				cout<<0<<'\n';
				continue;
			}
			assert(k);
			assert(n>1);
			
			c[n+1]=0;
			for(int i=1;i<k;i++)c[i]=c[i-1]+b[i],c[n-i+1]=c[n-i+2]+b[k-i+1];
			for(int i=k;i<=n-k+1;i++)c[i]=c[k-1]+b[k];
			
			int mid=k;x[mid]=0;
			for(int i=mid-1;i;i--){
				int mx=a[i]-x[i+1];
				if(i>1)mx=min(mx,a[i-1]);
				x[i]=mx;
			}
			for(int i=mid+1;i<=n;i++){
				int mx=a[i-1]-x[i-1];
				if(i<n)mx=min(mx,a[i]);
				x[i]=mx;
			}
			
			vector<pair<int,ll>>pre,suf;
			//pre
			if(mid>1){
				vector<pair<int,ll>>fr,bk;
				int l=a[mid-1]-x[mid-1],r=min(a[mid-1],a[mid]);
				for(int i=mid-1;i;i--){
					if(l>=r)break;
					if((mid-i)&1){
						//-
						fr.push_back({l,-c[i]});
						r=min(r,l+x[i]);
						bk.push_back({r,c[i]});
					}
					else{
						//+
						fr.push_back({l,c[i]});
						if(i>1){
							r=min(r,l+a[i-1]-x[i]);
							l+=a[i-1]-x[i]-x[i-1];
						}
						bk.push_back({r,-c[i]});
					}
				}
				swap(fr,pre);
				reverse(bk.begin(),bk.end());
				for(auto pr:bk)pre.push_back(pr);
				bk.clear();
			}
			if(1){
				assert(mid<n);
				vector<pair<int,ll>>fr,bk;
				fr.push_back({0,c[mid]});
				int l=a[mid]-x[mid+1],r=(mid>1?min(a[mid-1],a[mid]):a[mid]);
				bk.push_back({r,-c[mid]});
				for(int i=mid+1;i<=n;i++){
					if(l>=r)break;
					if((i-mid)&1){
						//-
						fr.push_back({l,-c[i]});
						r=min(r,l+x[i]);
						bk.push_back({r,c[i]});
					}
					else{
						//+
						fr.push_back({l,c[i]});
						if(i<n){
							r=min(r,l+a[i]-x[i]);
							l+=a[i]-x[i]-x[i+1];
						}
						bk.push_back({r,-c[i]});
					}
				}
				swap(suf,fr);
				reverse(bk.begin(),bk.end());
				for(auto pr:bk)suf.push_back(pr);
				bk.clear();
			}			
			__int128 now=0;
			for(int i=1;i<=n;i++)now+=(__int128)x[i]*c[i];
			__int128 ans=now,kk=0;
			
			auto p=pre.begin(),s=suf.begin();
			int lst=0;
			while(s!=suf.end()){
				auto&it=((p!=pre.end()&&p->first<=s->first)?p:s);
				now+=(it->first-lst)*kk;
				kk+=it->second;
				lst=it->first;
				it++;
				ans=max(ans,now);
			}
			assert(p==pre.end());
			
			print(ans);cout<<'\n';
		}
	}
	
}
signed main(){
	freopen("festival.in","r",stdin),
	freopen("festival.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	Solve::main();
	
	return 0;
}
